package so.sao.code.service.infrastructure.jpa.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.PrintFileDownloadMethod;

@Converter(autoApply = true)
public class PrintFileDownloadMethodConvert implements AttributeConverter<PrintFileDownloadMethod, Integer> {

	@Override
	public Integer convertToDatabaseColumn(PrintFileDownloadMethod attribute) {
		return attribute.getValue();
	}

	@Override
	public PrintFileDownloadMethod convertToEntityAttribute(Integer dbData) {
		return PrintFileDownloadMethod.fromValue(dbData);
	}

}
